from django.conf.urls.defaults import * 
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from blog.models import Artigo
from blog.feeds import UltimosArtigos

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'django_learn.views.home', name='home'),
    # url(r'^django_learn/', include('django_learn.foo.urls')),
    url(r'^$', 'django.views.generic.date_based.archive_index',
        {'queryset': Artigo.objects.all(), 'date_field': 'publicacao'}),
                       
    url(r'^rss/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
        {'feed_dict': {'ultimos': UltimosArtigos}}),
                       
    url(r'^artigo/(?P<artigo_id>\d+)/$', 'blog.views.artigo'),
    
    #url(r'^public/(.*)$', 'django.views.static.serve',
    #    {'document_root': settings.MEDIA_ROOT }),
    
    url(r'^contato/$', 'views.contato'),
     
    url(r'^comentarios/', include('django.contrib.comments.urls')),
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    
)

if settings.LOCAL:
    urlpatterns += patterns('',
        url(r'^public/(.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT}),
    )